﻿@using Newtonsoft.Json.Linq
@model FujiyBlog.Core.DomainObjects.WidgetSetting
@{
    JObject settings = JObject.Parse(Model.Settings ?? "{}");
}
Title: @Html.TextBox("Title" + Model.Id, settings.Value<string>("Title") ?? "Tag Cloud")<br /><br />
Minimum posts in each tag: @Html.TextBox("MinimumPosts" + Model.Id, settings.Value<int?>("MinimumPosts").GetValueOrDefault(1).ToString())<br /><br />
<a href="javascript:void(0);" onclick="javascript:fujiyBlog.widget.saveWidgetSettings(@Model.Id, JSON.stringify({ Title: $('#Title@(Model.Id)').val(), MinimumPosts: parseInt($('#MinimumPosts@(Model.Id)').val()) }));">
    Save
</a>